package com.mall.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mall.mapper.MemberLevelMapper;
import com.mall.model.domain.UmsMemberLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberLevelService {

    @Autowired
    private MemberLevelMapper memberLevelMapper;

    /**
     * 查询所有会员等级
     * @param defaultStatus
     * @return
     */
    public List<UmsMemberLevel> list(Integer defaultStatus) {
        LambdaQueryWrapper<UmsMemberLevel>lqw=new LambdaQueryWrapper<>();
        lqw.eq(defaultStatus!=null,UmsMemberLevel::getDefaultStatus,defaultStatus);
        List<UmsMemberLevel> levelList = memberLevelMapper.selectList(lqw);
        return levelList;
    }
}
